<template>
	<view>
		<view v-for="(node, index) in treeData" :key="index">
			<view>
				<view>
					<view :style="'padding-left:' + (zjflag * 40 + 20) + 'rpx;'" class="item_name" :id="index">
						<view>
							{{ node.materialCode }}
						</view>
						<text style="margin-left: 12rpx; margin-right: 22rpx">
							{{ node.mouldCode }}
						</text>
					</view>
				</view>
			</view>
			<view>
				<Tree v-if="node.details && node.details.length > 0" :tree-data="node.details" :zjflag="zjflag + 1" />
			</view>
		</view>
	</view>
</template>

<script setup lang="ts" name="Tree">
import { toRefs, ref } from 'vue';
import Tree from './tree.vue';
const props = defineProps({
	treeData: {
		required: true,
		default: () => []
	},
	uselast: {
		type: Boolean,
		default: false
	},
	zjflag: {
		type: Number,
		default: 0
	}
});

const { treeData, zjflag } = toRefs(props);
</script>

<style lang="scss" scoped>
.item_name {
	display: flex;
	justify-content: space-between;
	font-size: 14px;
	padding-top: 5rpx;
	padding-bottom: 5rpx;
	flex: 1;
	min-height: 36px;
	// min-height: tovmin(80);
	align-items: center;
	text-align: left;
	// margin-right: tovmin(64);
	color: #606266;
	overflow-y: auto;
	overflow-x: scroll;
	border-bottom: solid #efefef 2rpx;
	white-space: normal;
	word-break: break-all;
	word-wrap: break-word;
}
</style>
